package com.cuit.qx.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cuit.qx.aop.OperLog;
import com.cuit.qx.bean.ScheduledLog;
import com.cuit.qx.service.ScheduledLogService;
import com.cuit.qx.utils.ReturnData;
import com.cuit.qx.utils.ReturnStateCode;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lcj
 * @since 2021-02-05
 */
@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@RequestMapping("/api/scheduledLog")
public class ScheduledLogController {

    @Resource
    private ScheduledLogService scheduledLogService;

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    @OperLog(operModul = "定时器任务情况", operType = "1", operDesc = "查询定时器任务")
    public ReturnData queryList() {
        List<ScheduledLog> logList = scheduledLogService.list();
        if (logList.size()!=0){
            return new ReturnData(ReturnStateCode.SUCCEE.getCode(),ReturnStateCode.SUCCEE.getMsg(),logList);
        }
      return new ReturnData(ReturnStateCode.SUCCEEBUT.getCode(),ReturnStateCode.SUCCEEBUT.getMsg());
    }

}
